<script setup>
import { ref, onUpdated, onBeforeUpdate } from 'vue'

const count = ref(0)

onBeforeUpdate(() => {
  console.log('count beforeUpdate is ' + count.value)
})


onUpdated(() => {
  console.log('count update is ' + count.value)
})



</script>

<template>
  
  <div>
    
    <div>
      <button @click="count++" style="margin-right:10px">count is {{ count }}</button>
      <button @click="count=0">重置</button>
    </div>

  </div>
</template>


<style scoped>
button{
padding:10px;
font-size:15px;
line-height:1.5;
font-weight : bold;
color : red;
}
</style>